fun main(){
    val v1=verhicle("truck")
    v1.intro()
}
class verhicle(var type:String){
    var wheels:Int=0
     init{
        wheels=when(type){
            "truck"->6
            "car"->4
            "bike"->2
            else->0
        }
    }
    constructor(type:String,wheels:Int):this(type){
        this.wheels=wheels
    }
    fun intro() {
        println("我的类型是$type,有${wheels}个轮子")
    }
}
